﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace ajayumi.develop.win32.Transport.WCF.Services.Interfaces
{
    /// <summary>
    /// 硬盘驱动器接口
    /// Author  : 黄乙冬
    /// Date    : 2011-08-30
    /// </summary>
    [ServiceContract(SessionMode = SessionMode.Required)]
    public interface IDrive
    {
        /// <summary>
        /// 列出下级目录
        /// </summary>
        /// <param name="parentDir">上级目录，如果上级目录为空，则列出根目录</param>
        /// <param name="hasFile">包含文件</param>
        /// <returns>上级目录下的子目录</returns>
        [OperationContract]
        string[] GetDirectories(string parentDir, bool hasFile);

        /// <summary>
        /// 获取指定目录下的文件
        /// </summary>
        /// <param name="dir">目录</param>
        /// <param name="isRecursion">是否递归子目录</param>
        /// <returns></returns>
        [OperationContract]
        string[] GetFiles(string dir, bool isRecursion);

        /// <summary>
        /// 创建一个新的目录
        /// </summary>
        /// <param name="parentDir">上级目录</param>
        /// <param name="dirName">新目录名称</param>
        /// <returns>创建后的新目录路径</returns>
        [OperationContract]
        string CreateDir(string parentDir, string dirName);
    }
}
